SPB Git forge

spb/websensor

Public
33commits 1branches 0releases
3.4 MBsize
maindefault branch
10 days agolast push
TypeScript 55.4% Python 43.2% SQL 1.2%
652 B · 16 lines tsx
Raw Blame History
1import { notFound } from "next/navigation";2import type { ReactNode } from "react";3import { api } from "@/lib/api";45/**6 * Existence check outside the `loading.tsx` boundary: the page streams behind a skeleton, so a7 * `notFound()` thrown there would arrive after the 200 shell. Checking here yields a real 404.8 * (The page's own `api.entity()` call is deduplicated by the fetch memoization of the same render.)9 */10export default async function EntityLayout({ params, children }: { params: Promise<{ id: string }>; children: ReactNode }) {11  const { id } = await params;12  const d = await api.entity(id);13  if (!d) notFound();14  return children;15}16